<template>
  <div class="Review_results" v-if="result">
    <div class="Review_results_up">
      <div class="Review_results_left" v-if="adopt">
        <div>
          <span>评审结果：</span>
          <span>通过</span>
        </div>
        <img src="../../../assets/icon/true.png" />
      </div>
      <div class="Review_results_Fail" v-else>
        <div>
          <span>评审结果：</span>
          <span>不通过</span>
        </div>
        <img src="../../../assets/icon/error.png" />
      </div>

      <div class="Review_results_right">
        <div>
          <span>评审分数：</span>
          <span>{{ Review_fraction }}</span>
        </div>
        <img src="../../../assets/icon/fraction.png" />
      </div>
    </div>
    <div
      class="Review_results_down"
      v-for="(item, index) in Review_results"
      :key="index"
    >
      <div>
        <!-- 行 -->
        <div class="Review_results_down_line">
          <span>评委：</span>
          <span>{{ item.realName }}</span>
        </div>

        <div class="Review_results_down_line">
          <span>评分:</span>
          <span>{{ item.sum }}</span>
        </div>

        <div class="Review_results_down_line">
          <span>评语：</span>
          <span>{{ item.evaluation }}</span>
        </div>
      </div>
    </div>
  </div>

  <el-empty
    v-else
    class="Review_results_no"
    :description="Review_status"
  ></el-empty>
</template>

<script>
export default {
  props: {},
  components: {},
  data() {
    return {
      result: "",
      adopt: "",
      Review_status: "",
      Review_fraction: "",
      Review_results: [],
    };
  },
  methods: {},
  async created() {
    //获取上传文件

    const { data: res } = await this.$http({
      headers: { "Content-Type": "application/json;charset=UTF-8" },
      method: "get",
      url: "/api/apply/getStatusScore",
    });
    if (res.code != 200) {
      return;
    }
    console.log(res);
    if (res.msg.applyStatus == -1) {
      this.adopt = false;
      this.result = true;
      this.Review_fraction = res.msg.lastScore;
    }
    if (res.msg.applyStatus == 0) {
      this.result = false;
      this.Review_status = "正在申请中！";
      return;
    }
    if (res.msg.applyStatus == 1) {
      this.result = false;
      this.Review_status = "正在评审中！";
      return;
    }
    if (res.msg.applyStatus == 2) {
      this.result = true;
      this.adopt = true;
      this.Review_fraction = res.msg.lastScore;
    }

    const { data: result } = await this.$http({
      headers: { "Content-Type": "application/json;charset=UTF-8" },
      method: "get",
      url: "/api/apply/getNameSumEv",
    });
    console.log(result);
    this.Review_results = result.msg;
  },
};
</script>

<style lang="less">
.Review_results {
  height: 877px;
  width: 95%;
  overflow: auto;
  margin: 0px auto;
  // background-color: rgb(216, 16, 16);
}
.Review_results::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: rgb(213, 216, 218);
}
.Review_results::-webkit-scrollbar {
  width: 10px;
}
.Review_results_up {
  height: 104px;
  width: 864px;
  margin: auto;
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  .Review_results_left {
    background: linear-gradient(left top, rgb(46, 221, 118), rgb(51, 205, 103));
  }
  .Review_results_right {
    background: -webkit-linear-gradient(
      left top,
      rgb(255, 184, 84),
      rgb(246, 156, 36)
    );
  }
  .Review_results_Fail {
    background: -webkit-linear-gradient(
      left top,
      rgb(244, 101, 101),
      rgb(254, 149, 149)
    );
  }
  div {
    display: flex;
    width: 281px;
    height: 100%;
    flex-direction: row;
    justify-content: space-between;

    border-radius: 10px;
    div {
      margin: 20px 0px 20px 20px;
      height: 50%;
      width: 50%;
      display: flex;
      flex-direction: column;
      background: none;
      span {
        color: #fff;
      }
      span:nth-child(2) {
        margin-top: 9px;
        font-weight: bold;
        font-size: 30px;
      }
    }
    img {
      height: 70px;
      display: flex;
      margin: auto;
      width: 70px;
      filter: alpha(opacity=50);
      opacity: 0.5;
    }
  }
}
.Review_results_down {
  border-bottom: 1px solid rgb(215, 215, 215);
  display: flex;
  margin: auto;
  width: 90%;
  height: 200px;
  flex-direction: column;
  div {
    display: flex;
    flex-direction: column;
    height: 150px;
    width: 95%;
    margin: auto;
    .Review_results_down_line {
      width: 100%;
      flex-direction: row;
      display: flex;
      span:nth-child(1) {
        width: 6%;
        font-weight: bold;
      }
      span:nth-child(2) {
        display: flex;
        width: 90%;
        white-space: normal;
        word-break: break-all;
        word-wrap: break-word;
        white-space: normal;
      }
    }
  }
}
.Review_results_no {
  margin: auto;
}
//
</style>